<%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<% content_for :head do%>
  <base target="_top" />
<% end %>
<ul id="quiz_student_details">
  <li>
    <span class="title">{{#t}}Due{{/t}}</span>
    <span class="value">
      <% if @quiz.multiple_due_dates_apply_to?(@current_user) %>
        {{#t}}Multiple Due Dates{{/t}}
      <% elsif due_at = @quiz.overridden_for(@current_user).due_at %>
        <span <%= context_sensitive_datetime_title(due_at, @quiz.context) %>>
          <%= datetime_string(due_at) %>
        </span>
      <% else %>
        {{#t}}No due date{{/t}}
      <% end %>
    </span>
  </li>

  <li style="<%= hidden if @quiz.quiz_type == 'survey' %>">
    <span class="title">{{#t}}Points{{/t}}</span>
    <span class="value"><%= round_if_whole(@quiz.points_possible) || 0 %></span>
  </li>

  <li>
    <span class="title">{{#t}}Questions{{/t}}</span>
    <span class="value"><%= @question_count || 0 %></span>
  </li>
  {{> views/shared/available_dates}}
  <li>
    <span class="title">{{#t}}Time Limit{{/t}}</span>
    <span class="value">
      <% if @quiz.time_limit %>
        <%= t(:time_limit, "Minute", :count => @quiz.time_limit + ((@submission && @submission.extra_time) || 0)) %>
      <% else %>
        {{#t}}None{{/t}}
      <% end %>
    </span>
  </li>

  <% if @quiz.allowed_attempts && @quiz.allowed_attempts != 1 %>
    <li>
      <span class="title">{{#t}}Allowed Attempts{{/t}}</span>
      <span class="value">
        <% if @quiz.allowed_attempts > 0 %>
          <%= ((@submission && @submission.extra_attempts) || 0) + @quiz.allowed_attempts %>
        <% else %>
          {{#t}}Unlimited{{/t}}
        <% end %>
      </span>
    </li>
  <% end %>

  <% if @quiz.require_lockdown_browser %>
    <li>
      <span class="value">{{#t}}Requires Respondus LockDown Browser{{/t}}</span>
    </li>
  <% end %>
</ul>
